package org.ihelpuoo.weboo.action.http.db;

import java.util.List;

import org.ihelpuoo.orm.IIIException;
import org.ihelpuoo.orm.filter.FieldFilter;
import org.ihelpuoo.orm.filter.Filter;
import org.ihelpuoo.util.Pager;
import org.ihelpuoo.weboo.action.http.AjaxListAction;
import org.ihelpuoo.weboo.module.ActionContext;

public class QueryAction extends AjaxListAction
{

	@Override
	protected List generateList(ActionContext context, Pager pager) throws Exception
	{
		Filter filter = context.getObjectFilter();
		FieldFilter actived = context.properties().getDBIOActivedFieldFilter();
		FieldFilter locked = context.properties().getDBIOLockedFieldFilter();
		Class type = context.properties().getObjectType();
		Object refer = context.getReferObject();

		return doQuery(context,pager,filter,actived,locked,type,refer);
	}

	protected List doQuery(ActionContext context, Pager pager, Filter filter,
			FieldFilter actived, FieldFilter locked, Class type, Object refer) throws IIIException
	{
		return context.pojo().query(type,filter,actived,locked,pager,refer);
	}

}
